
<%@ page import="aiball.Player" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'player.label', default: 'Player')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#show-player" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
				<li><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
		<div id="show-player" class="content scaffold-show" role="main">
			<h1><g:message code="default.show.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
				
			<ol class="property-list player">
			<li class="fieldcontain">	
				<g:if test="${playerInstance?.name}">
					<br><span id="name-label" class="property-label"><g:message code="player.name.label" default="Name" />:</span>
					<span class="property-value" aria-labelledby="name-label"><g:fieldValue bean="${playerInstance}" field="name"/></span><br><br>
				</g:if>
			</li>
			
			<h1>Statistiken</h1>
			
			<li class="fieldcontain">	
				<table>
				<thead>
					<tr>
						<td>Spiel</td>
						<td>Tore</td>
						<td>gelbe Karten</td>
						<td>rote Karten</td>
						<td>gelaufene Meter</td>
						<td>Ballkontakte</td>
					</tr>
				</thead>
				<tbody>
					<g:each in="${playerStatsInstanceList}" status="j" var="stat">
					<g:if test="${stat?.player?.id == playerInstance?.id}">
					<tr>
						<td><g:link controller="Gamecharts" action="show" id="${stat?.game?.id}">${stat?.game?.team1.name.encodeAsHTML()} vs. ${stat?.game?.team2.name.encodeAsHTML()} </g:link></td>
						<td>${stat?.goals}</td>
						<td>${stat?.yellowCards}</td>
						<td>${stat?.redCards}</td>
						<td>${stat?.fieldsPassed}</td>
						<td>${stat?.ballContacts}</td>
					</tr>
					</g:if>
					</g:each>
				</tbody>
				</table>
			</li>
			</ol>
			
			
			<g:form>
				<fieldset class="buttons">
					<g:hiddenField name="id" value="${playerInstance?.id}" />
					<g:link class="edit" action="edit" id="${playerInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
					</fieldset>
			</g:form>
		</div>
	</body>
</html>
